<template>
  <view v-if="visible" class="popup-mask">
    <view class="popup-content">
      <view class="title">
        <image
          src="/static/success.png" 
          class="success-icon"
        />
      已提交申请</view>
      <view class="desc">
        感谢您的反馈，我们会尽快核实球杆信息并加入到 可选分类中请您耐心等待。
      </view>
      <button class="submit-btn" @click="onConfirm">下一步</button>
    </view>
  </view>
</template>

<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'

const props = defineProps({
  visible: Boolean,
  brand: String,
  model: String,
})

const emits = defineEmits(['update:visible'])

const router = useRouter()

const onConfirm = () => {
  emits('update:visible', false)
  const name = `${props.brand}/${props.model}`
  // 也可以跳转其他页面
  uni.navigateTo({
    url: `/pages/index/form2?name=${encodeURIComponent(name)}`
  })
}
</script>

<style scoped>
.popup-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.popup-content {
  background-color: #fff;
  border-radius: 20rpx;
  padding: 60rpx 40rpx;
  width: 600rpx;
  text-align: center;
}

.success-icon {
  width: 64rpx;
  height: 64rpx;
  margin-right: 10rpx;
}

.title {
  font-size: 36rpx;
  font-weight: bold;
  margin-bottom: 20rpx;
  display: flex;
  align-items: center;
  justify-content: center;
}

.desc {
  font-size: 28rpx;
  color: rgba(0, 0, 0, 0.3);
  margin-bottom: 40rpx;
}

.submit-btn {
  background: linear-gradient(to right, #45b5ff, #2b65f6);
  color: white;
  font-size: 32rpx;
  border-radius: 24rpx;
  width: 580rpx;
  height: 104rpx;
  line-height: 104rpx;
  margin: auto;
}
</style>
